package mailsystem.states;

import mailsystem.Connection;
import mailsystem.TelephoneResources;

public class MailBoxMenuStatus implements State {

	@Override
	public void runAction(Connection c, String key) {
		if (key.equals("1")) {
			c.setState(Connection.MESSAGEMENU);			
			c.showDisplayAllPhones(TelephoneResources.MESSAGE_MENU_TEXT);			
		} else if (key.equals("2")) {
			c.setState(Connection.CHANGEPASSCODE);
			c.speakAllPhones(TelephoneResources.NEWPASSCODE);			
		} else if (key.equals("3")) {			
			c.setState(Connection.CHANGEGREETING);
			c.speakAllPhones(TelephoneResources.NEWGREETING);
		} else if (key.equals("4"))
		{
			c.setState(Connection.CHANGENAME);
			c.speakAllPhones(TelephoneResources.NEWNAME);
		}
		else if (key.equals("5"))
		{
			c.setState(Connection.ADDCONTACT);
			c.speakAllPhones(TelephoneResources.ADD_CONTACT);
		}
	}

}
